<template>
	<view style="width: 100%;">
		<view class="change-top">
			电池设置
			<img @click="back" src="@/static/img/common_btn_return_n.png" alt="">
		</view>
		<view v-for="item in battery_list" class="set-item">
			<u-radio-group v-model="check">
				 <u-radio @change='change_battery(item.name)'  :name="item.name">{{item.name}}</u-radio>
				 </u-radio-group>
		</view>
	</view>
	
</template>

<script>
	export default{
		data(){
			return{
				battery_list:[
					{"id":1,"name":"EU2001"},
					{"id":2,"name":"EU2002"},
					{"id":3,"name":"EU2003"},
				],
				check:'EU2002'
			}
		},
		onShow() {
			this.check = uni.getStorageSync('battery_type');
		},
		methods:{
			back(){
				uni.navigateBack({
				    delta: 1
				});
			},
			change_battery(name){
				uni.setStorageSync('battery_type',name);
				uni.navigateBack({
				    delta: 2
				});
			}
		}
	}
	
</script>

<style>
	.change-top{
			font-size: 16px;
			color: #35374b;
			text-align: center;
			height: 80px;
			line-height: 100px;
			border-bottom: 1px solid #DEDFE2;
		}
		.change-top img{
			position: absolute;
			left: 0px;
			top: 26px;
			padding: 12px;
		}
		.change-top img:active{
		  background-color: #eee;
	  }
		.set-item{
			height: 60px;
			border-bottom: 1px solid #e1e1e3;
			margin: 0 12px 0 12px;
			padding-left: 10px;
			font-size: 15px;
			color: #35374B;
			line-height: 60px;
		}
		.set-item-right{
			float: right;
			font-size: 14px;
			color: #abacb4;
		}
		.set-item-right img{
			float: right;
			margin-top: 21px;
			margin-left: 6px;
		}
</style>
